package xyz.naoyu.entity;

import com.alibaba.fastjson.JSONObject;


import java.util.ArrayList;

/**
 * @author yWieLoc
 * @date 2022/3/14 14:49
 */
public class Currency extends EntityBase {

    // ID = Cxx

    protected String name;
    protected ArrayList<String> tags;
    protected String details;     // 一个json文档模板

    public Currency() {
    }

    public Currency(String id) {
        super(id);
    }

    public Currency(String id, String name) {
        super(id);
        super.type = "Currency";
        this.name = name;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ArrayList<String> getTags() {
        return tags;
    }

    public void setTags(ArrayList<String> tags) {
        this.tags = tags;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String temp) {
        details = temp;
    }


    public void tagsUpdate() {
        // 标签更新请求
    }

    public void tagsDel(String tagName) {

        tagsUpdate();
    }
    public void tagsAdd(String tagName) {

        tagsUpdate();
    }

    /**
     * 检测两者模板参数是否相等
     * @param dtl
     * @return
     */
    public boolean detailCk(JSONObject dtl) {
        JSONObject temp = JSONObject.parseObject(details);
        return temp.keySet() == temp.keySet();
    }


}
